package com.ugoodtech.mdcc.core.domain;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

import javax.persistence.*;
import java.util.Date;
import java.util.List;

@ApiModel("投诉单")
@Entity
@Table(name = "complaint_report")
public class ComplaintReport extends BaseEntity {

    @ApiModelProperty("创建报告人")
    private User user;

    @ApiModelProperty("跟进报告人")
    private User followUser;

    @ApiModelProperty("报告跟进状态")
    private Integer reportStatus = 0;

    @ApiModelProperty("是否完成")
    private boolean isComplete = false;

    @ApiModelProperty("有效时间")
    private Long validTime;

    @ApiModelProperty("完成时间")
    private Date completeTime;

    @ApiModelProperty("审核时间")
    private Date auditTime;

    @ApiModelProperty("变更状态时间")
    private Date changeTime;

    @ApiModelProperty("用时--（审核时间-完成时间）")
    private Integer timeWork;

    @ApiModelProperty("是否领取")
    private boolean isReceive = false;

    @ApiModelProperty("是否审核")
    private boolean isAudit = false;

    @ApiModelProperty("是否超时返回")
    private boolean isBack = false;

    @ApiModelProperty("投诉解决方案是否自己跟进，如果自行跟进那么就设为1，用户可以修改。否则就设为2")
    private Integer isFollow = 0;

    @ApiModelProperty("需要跟进的人")
    private List<Long> needUserList;

    @ApiModelProperty("需要跟进的上级")
    private Long leader;

    @ApiModelProperty("投诉的等级")
    private Integer complaintLevel;

    @ApiModelProperty("自行跟进的投诉解决方案ID")
    private Long complaintSolutionId;

    @ApiModelProperty("创建解决方案时的时间")
    private Date solutionTime;

    @ApiModelProperty("是否发送超时短信")
    private boolean isSendMessage = false;

    @ApiModelProperty("预计完成时间 只用于")
    private Date scheduledTime;

    @ApiModelProperty("是否发送预计时间提醒短信")
    private boolean isSendScheduledTimeMessage = false;

    @ApiModelProperty("第一次审核时间")
    private Date firstAuditTime;

    @ApiModelProperty("最近一次的投诉解决方案ID")
    private Long solutionId;

    @ApiModelProperty("第一次自行跟进的时间")
    private Date firstFollowTime;

    @ApiModelProperty("是否审核不通过")
    private boolean isAuditFalse = false;

    @ApiModelProperty("审核不通过时的原因")
    private String auditFalseNote;

    @ApiModelProperty("是否有大区经理跟进过")
    private boolean isLeaderFollow = false;

    @ApiModelProperty("审核时：上级领导跟进带入的备注")
    private String otherFollowNote;

    @ApiModelProperty("是否超时过：false没有超时过，true超时过")
    private boolean timeOut = false;

    @ManyToOne
    @JoinColumn(name = "user_id")
    public User getUser() {
        return user;
    }

    public void setUser(User user) {
        this.user = user;
    }

    @ManyToOne
    @JoinColumn(name = "follow_user_id")
    public User getFollowUser() {
        return followUser;
    }

    public void setFollowUser(User followUser) {
        this.followUser = followUser;
    }

    @Column(name = "report_status")
    public Integer getReportStatus() {
        return reportStatus;
    }

    public void setReportStatus(Integer reportStatus) {
        this.reportStatus = reportStatus;
    }

    @Column(name = "is_complete")
    public boolean isComplete() {
        return isComplete;
    }

    public void setComplete(boolean complete) {
        isComplete = complete;
    }

    @Column(name = "valid_time")
    public Long getValidTime() {
        return validTime;
    }

    public void setValidTime(Long validTime) {
        this.validTime = validTime;
    }

    @Column(name = "complete_time")
    public Date getCompleteTime() {
        return completeTime;
    }

    public void setCompleteTime(Date completeTime) {
        this.completeTime = completeTime;
    }

    @Column(name = "audit_time")
    public Date getAuditTime() {
        return auditTime;
    }

    public void setAuditTime(Date auditTime) {
        this.auditTime = auditTime;
    }

    @Column(name = "time_work")
    public Integer getTimeWork() {
        return timeWork;
    }

    public void setTimeWork(Integer timeWork) {
        this.timeWork = timeWork;
    }

    @Column(name = "change_time")
    public Date getChangeTime() {
        return changeTime;
    }

    public void setChangeTime(Date changeTime) {
        this.changeTime = changeTime;
    }

    @Column(name = "is_receive")
    public boolean isReceive() {
        return isReceive;
    }

    public void setReceive(boolean receive) {
        isReceive = receive;
    }

    @Column(name = "is_audit")
    public boolean isAudit() {
        return isAudit;
    }

    public void setAudit(boolean audit) {
        isAudit = audit;
    }

    @Column(name = "is_back")
    public boolean isBack() {
        return isBack;
    }

    public void setBack(boolean back) {
        isBack = back;
    }

    @Column(name = "need_user_id")
    @ElementCollection(fetch = FetchType.EAGER)
    public List<Long> getNeedUserList() {
        return needUserList;
    }

    public void setNeedUserList(List<Long> needUserList) {
        this.needUserList = needUserList;
    }

    @Column(name = "leader_user_id")
    public Long getLeader() {
        return leader;
    }

    public void setLeader(Long leader) {
        this.leader = leader;
    }

    @Column(name = "is_follow")
    public Integer getIsFollow() {
        return isFollow;
    }

    public void setIsFollow(Integer isFollow) {
        this.isFollow = isFollow;
    }

    @Column(name = "complaint_level")
    public Integer getComplaintLevel() {
        return complaintLevel;
    }

    public void setComplaintLevel(Integer complaintLevel) {
        this.complaintLevel = complaintLevel;
    }

    @Column(name = "solution_id")
    public Long getComplaintSolutionId() {
        return complaintSolutionId;
    }

    public void setComplaintSolutionId(Long complaintSolutionId) {
        this.complaintSolutionId = complaintSolutionId;
    }

    @Column(name = "solution_time")
    public Date getSolutionTime() {
        return solutionTime;
    }

    public void setSolutionTime(Date solutionTime) {
        this.solutionTime = solutionTime;
    }

    @Column(name = "is_send_message")
    public boolean isSendMessage() {
        return isSendMessage;
    }

    public void setSendMessage(boolean sendMessage) {
        isSendMessage = sendMessage;
    }

    @Column(name = "scheduled_time")
    public Date getScheduledTime() {
        return scheduledTime;
    }

    public void setScheduledTime(Date scheduledTime) {
        this.scheduledTime = scheduledTime;
    }

    @Column(name = "is_send_scheduled_time")
    public boolean isSendScheduledTimeMessage() {
        return isSendScheduledTimeMessage;
    }

    public void setSendScheduledTimeMessage(boolean sendScheduledTimeMessage) {
        isSendScheduledTimeMessage = sendScheduledTimeMessage;
    }

    @Column(name = "first_audit_time")
    public Date getFirstAuditTime() {
        return firstAuditTime;
    }

    public void setFirstAuditTime(Date firstAuditTime) {
        this.firstAuditTime = firstAuditTime;
    }

    @Column(name = "near_solution_id")
    public Long getSolutionId() {
        return solutionId;
    }

    public void setSolutionId(Long solutionId) {
        this.solutionId = solutionId;
    }

    @Column(name = "first_follow_time")
    public Date getFirstFollowTime() {
        return firstFollowTime;
    }

    public void setFirstFollowTime(Date firstFollowTime) {
        this.firstFollowTime = firstFollowTime;
    }

    @Column(name = "is_audit_false")
    public boolean isAuditFalse() {
        return isAuditFalse;
    }

    public void setAuditFalse(boolean auditFalse) {
        isAuditFalse = auditFalse;
    }

    @Column(name = "audit_false_note")
    public String getAuditFalseNote() {
        return auditFalseNote;
    }

    public void setAuditFalseNote(String auditFalseNote) {
        this.auditFalseNote = auditFalseNote;
    }

    @Column(name = "is_leader_follow")
    public boolean isLeaderFollow() {
        return isLeaderFollow;
    }

    public void setLeaderFollow(boolean leaderFollow) {
        isLeaderFollow = leaderFollow;
    }

    @Column(name = "other_follow_note")
    public String getOtherFollowNote() {
        return otherFollowNote;
    }

    public void setOtherFollowNote(String otherFollowNote) {
        this.otherFollowNote = otherFollowNote;
    }

    @Column(name = "is_time_out")
    public boolean isTimeOut() {
        return timeOut;
    }

    public void setTimeOut(boolean timeOut) {
        this.timeOut = timeOut;
    }
}
